//
//  WVShapesView.m
//  Windows and Views
//
//  Created by Tim Isted on 07/10/2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "WVShapesView.h"


@implementation WVShapesView

- (id)initWithFrame:(NSRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
    }
    return self;
}

- (void)drawRect:(NSRect)dirtyRect {
    NSRect viewBounds = [self bounds];
    NSColor *currentColor = [NSColor whiteColor];
    [currentColor set];
    NSRectFill(viewBounds);
    
    currentColor = [NSColor blackColor];
    [currentColor set];
    NSFrameRect(viewBounds);
    
    NSRect squareRect = NSInsetRect(viewBounds, 15, 15);
    
    currentColor = [NSColor lightGrayColor];
    [currentColor set];
    NSRectFill(squareRect);
    
    NSRect ovalRect = NSInsetRect(squareRect, 40.0, 40.0);
    NSBezierPath *ovalPath = [NSBezierPath bezierPathWithOvalInRect:ovalRect];
    
    currentColor = [NSColor purpleColor];
    [currentColor set];
    [ovalPath fill];
    
    currentColor = [NSColor darkGrayColor];
    [currentColor set];
    [ovalPath setLineWidth:5.0];
    [ovalPath stroke];
}

@end
